<!DOCTYPE html>
<html
        xmlns:th="http://www.thymeleaf.org"
        xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
>
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" href="/assets/css/table.css?v=3"/>
    <link rel="stylesheet" href="/assets/js/css/layui.css"/>
    <title>Document</title>
</head>

<body>
<div class="container">
    <!-- 上表格 -->
    <div class="half_height">
        <table class="layui-hide" id="test" lay-filter="test"></table>
    </div>

    <!-- 下表格 -->
    <div class="half_height display-none" id="__bottom">
        <table class="layui-hide" id="test-2" lay-filter="test-2"></table>
    </div>

    <!-- 上传excel -->
    <input
            type="file"
            class="upload"
            id="upload_top"
            onchange="importf(this,key_file_1,params_id,0)"
    />
    <input
            type="file"
            class="upload"
            id="upload_bottom"
            onchange="importf(this,key_file_2,params_id,1)"
    />

    <!-- 上传多文件 -->
    <div style="position: absolute; left: -9999px">
        <div class="layui-upload" id="multi_upload">
            <div>
                <button
                        type="button"
                        class="layui-btn layui-btn-normal"
                        id="multi_upload__select"
                >
                    批量挂接
                </button>
                <button type="button" class="layui-btn" id="multi_upload__submit">
                    开始上传
                </button>
            </div>
            <div class="layui-upload-list">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>大小</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="multi_upload__List"></tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<!-- 上表格头部工具栏 -->
<script type="text/html" id="toolbarDemo">
    <div>
        搜索：
        <div class="layui-inline custom_width_100">
            <input
                    class="layui-input"
                    name="id"
                    id="test_Reload__input"
                    autocomplete="off"
            />
        </div>
        <button
                class="layui-btn layui-btn-radius layui-btn-normal"
                lay-event="search_Test"
                data-type="reload"
        >
            <i class="layui-icon">&#xe615;</i>
        </button>
        <button
                class="layui-btn layui-btn-sm"
                lay-event="showAll"
                shiro:hasPermission="archives"
        >
            显示全部
        </button>
        <button
                class="layui-btn layui-btn-sm"
                lay-event="addNew"
                shiro:hasPermission="archive:add"
        >
            添加
        </button>
        <button
                type="button"
                class="layui-btn layui-btn-sm"
                lay-event="upload_top"
                shiro:hasPermission="archive:upload"
        >
            <i class="layui-icon">&#xe67c;</i> 上传目录
        </button>


        <button
                type="button"
                class="layui-btn layui-btn-sm"
                lay-event="multi_upload"
                shiro:hasPermission="file:upload"
        >
            批量挂接
        </button>
        <button
                type="button"
                class="layui-btn layui-btn-sm"
                onclick='window.open("/download/文件目录")'
                shiro:hasPermission="archive:model"
        >
            <i class="layui-icon">&#xe67c;</i> 目录模板
        </button>
    </div>
</script>

<!-- 上表格行内工具栏 -->
<script type="text/html" id="barDemo">
    <a
            class="layui-btn layui-btn-normal layui-btn-xs"
            lay-event="view"
            shiro:hasPermission="archive:show"
    >查询</a
    >
    <a
            class="layui-btn layui-btn-xs"
            lay-event="edit"
            shiro:hasPermission="archive:edit"
    >编辑</a
    >
    <a
            class="layui-btn layui-btn-danger layui-btn-xs"
            lay-event="del"
            shiro:hasPermission="archive:delete"
    >删除</a
    >
</script>

<!-- 下表格头部工具栏 -->
<script type="text/html" id="toolbarDemo-2">
    <div>
        搜索：
        <div class="layui-inline custom_width_100">
            <input
                    class="layui-input"
                    name="id"
                    id="test_Reload__input_2"
                    autocomplete="off"
            />
        </div>
        <button
                class="layui-btn layui-btn-radius layui-btn-normal"
                lay-event="search_Test_2"
                data-type="reload"
        >
            <i class="layui-icon">&#xe615;</i>
        </button>
        <button
                class="layui-btn layui-btn-sm"
                lay-event="showAll_2"
                shiro:hasPermission="cases"
        >
            显示全部
        </button>
        <button
                class="layui-btn layui-btn-sm"
                lay-event="addNew_2"
                shiro:hasPermission="case:add"
        >
            添加
        </button>

        <button
                type="button"
                class="layui-btn layui-btn-sm"
                onclick='javascript:$("#upload_bottom").click();'
                shiro:hasPermission="case:upload"
        >
            <i class="layui-icon">&#xe67c;</i> 上传目录
        </button>
        <button
                type="button"
                class="layui-btn layui-btn-sm"
                onclick='window.open("/download/案卷目录")'
                shiro:hasPermission="case:model"
        >
            <i class="layui-icon">&#xe67c;</i> 目录模板
        </button>
    </div>
</script>

<!-- 下表格行内工具栏 -->
<script type="text/html" id="barDemo-2">
    <a
            class="layui-btn layui-btn-normal layui-btn-xs"
            lay-event="view-2"
            shiro:hasPermission="file:show"
    >查看</a
    >
    <a
            class="layui-btn layui-btn-xs"
            lay-event="edit-2"
            shiro:hasPermission="case:edit"
    >编辑</a
    >
    <a
            class="layui-btn layui-btn-danger layui-btn-xs"
            lay-event="del-2"
            shiro:hasPermission="case:delete"
    >删除</a
    >
</script>
</body>
</html>
<script>
    var params_id = [[${id}]];//上表格所需要的当前案卷id
    console.log(params_id);
</script>
<script src="/assets/js/jquery-3.5.1.min.js"></script>
<script src="/assets/js/layui.js" charset="utf-8"></script>
<script src="/assets/js/xlsx.full.min.js"></script>
<!--<script src="/assets/js/pdf.js"></script>-->
<!--<script src="/assets/js/pdf.worker.js"></script>-->
<!-- 引入的弹出层内容 -->
<script src="/assets/js/biaoge/tableEdit.js"></script>
<!-- 上方为依赖，下方config为存放本页面的全局变量 -->
<script src="/assets/js/biaoge/config.js"></script>
<!-- 多文件上传 -->
<script src="/assets/js/biaoge/mul_upload.js"></script>
<script>
    const __fileType = sessionStorage.getItem("__fileType");
    if (__fileType !== "0") {
        // <!-- 下表格 -->
        $("#__bottom").removeClass("display-none");
        var _script = document.createElement("script");
        _script.src = "/assets/js/biaoge/bottom_table.js";
        document.body.appendChild(_script);
    } else {
        layui_table_view__height = layui_table_view__height * 2;
    }
</script>
<!-- 上表格 -->
<script src="/assets/js/biaoge/top_table.js?version=15"></script>
<!-- 上传excel -->
<script src="/assets/js/biaoge/excel.js"></script>